package finance

import (
	"github.com/gin-gonic/gin"
	"go-papers/models"
	"go-papers/tools/app"
)

func MomShare(c *gin.Context) {
	//进行微信 打款给用户
	var ss models.OrderShare
	err := c.ShouldBindJSON(&ss)
	if err != nil {
		app.CommonResp(c, -1, "数据解析异常"+err.Error(), nil)
		return
	}

	result, err := ss.Update(ss.OrderShareId)
	if err != nil {
		app.CommonResp(c, -1, "处理异常"+err.Error(), nil)
		return
	}

	app.CommonResp(c, -1, "暂时不支持微信直接给达人付款", result)

}

// 确认佣金结算 状态
//  ---- 机构已退回
//  ---- 用户佣金已退回
func SureShare(c *gin.Context) {
	var ss models.OrderShare
	err := c.ShouldBindJSON(&ss)
	if err != nil {
		app.CommonResp(c, -1, "数据解析异常"+err.Error(), nil)
		return
	}

	result, err := ss.Update(ss.OrderShareId)
	if err != nil {
		app.CommonResp(c, -1, "处理异常"+err.Error(), nil)
		return
	}
	app.CommonResp(c, 0, "修改成功", result)

}
